Open
Conversation
…ect user input on the server, unsused for now
| var output = document.getElementById("outputValue"); | ||
|
|
||
| let filepath_start = "/static/map_"; | ||
|
|
Owner
Author
There was a problem hiding this comment.
should replace var with let for consistency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here's my solution for task 2.
The original intention was to use flask to collect data from the client (web browser) side of the app, perform the data processing to generate a new folium map on the server side, and send it back to the client. This proved far trickier than anticipated and probably isn't actually the best way to go about this (it doesn't sound very scalable), a much easier workaround was to generate all the different maps needed in advance and store them in the web application's static data folder. Then we just use javascript to select which version of the map we want based on the slider value, so everything is happening on the client side (I think)
The major problem is the loading time of the new map, it looks quite bad when the slider is moved. There's a recent article in the Independent where the data journalist who worked on the article ran into the same problem and also couldn't figure out how to fix it: https://www.independent.co.uk/news/uk/home-news/house-prices-growth-renting-increase-uk-b2721895.html
I don't think this is a trivial problem, it's probably related to Folium/Leaflet itself not really being designed for being used like this. A bespoke choropleth map with less overhead than Folium/Leaflet (e.g. no interactivity or animations) would be the quickest solution to this